package com.simpou.tests.rest.service;

import com.simpou.tests.rest.model.SerializableObject;
import java.util.Date;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;


@Path("/cached")
public class CachedService {
    private static final Date DATE = new Date();
    private static final SerializableObject OBJECT = new SerializableObject();

    @GET
    @Path("/object")
    public Response getObject(@Context
    Request request) {
        return RestService.getCachedObject(request, OBJECT, DATE,
            OBJECT.getName()).build();
    }
}
